<?php
/**
 * Created by PhpStorm.
 * User: yiyu
 * Email: smalleasyu@gmail.com
 * Date: 2020-01-22 13:30:48
 * Desc:
 */

namespace app\api\controller\wx;

use app\api\controller\ApiBaseController;
use app\base\service\WeChat\OfficialAccountMessageHandlerService;
use app\base\service\WeChat\MiniProgramMessageHandlerService;
use app\base\service\WeChat\WeChatBaseService;
use EasyWeChat\Factory;
use app\core\log\Log4dd;
use think\Request;

class AutoReplyController extends ApiBaseController
{

    /**
     * Desc: 微信公众号自动回复
     * Date: 2020/1/22 13:35
     * Author: yiyu
     */
    public function officialAccountMessageHandler()
    {
        return OfficialAccountMessageHandlerService::instance()->AutoReply();
    }

    /**
     * Desc: 微信小程序客服自动回复
     * Date: 2020/2/24 14:24
     * Author: yiyu
     * @return MiniProgramMessageHandlerService
     */
    public function miniProgramMessageHandler()
    {
        Log4dd::info('小程序客服接收原始消息', Request::instance()->param(false));
        return MiniProgramMessageHandlerService::instance()->AutoReply();
    }


}